
 
 N A M E 
 
         N e w - V M 
 
         
 
 S Y N O P S I S 
 
         C r e a t e s   a   v i r t u a l   m a c h i n e   t o   b e   m a n a g e d   b y   V i r t u a l   M a c h i n e   M a n a g e r . 
 
         
 
         E X A M P L E   1 :   C r e a t e   a   v i r t u a l   m a c h i n e   f r o m   a   v i r t u a l   h a r d   d i s k   a n d   d e p l o y   i t   o n   a   h o s t . 
 
         
 
         P S   C : \ >   G e t - V M M S e r v e r   - C o m p u t e r N a m e   " V M M S e r v e r 1 . C o n t o s o . c o m " 
 
         P S   C : \ >   $ V H D   =   G e t - V i r t u a l H a r d D i s k   |   w h e r e   { $ _ . N a m e   - e q   " B l a n k   D i s k   -   L a r g e " } 
 
         P S   C : \ >   $ V M H o s t   =   G e t - V M H o s t   |   w h e r e   { $ _ . N a m e   - e q   " V M H o s t 0 1 . C o n t o s o . c o m " } 
 
         P S   C : \ >   N e w - V M   - N a m e   " V M 0 1 "   - V i r t u a l H a r d D i s k   $ V H D   - V M H o s t   $ V M H o s t   - P a t h   " C : \ M y V M s "    R u n A s y n c h r o n o u s l y 
 
         
 
         
 
         T h e   f i r s t   c o m m a n d   c o n n e c t s   t o   V M M S e r v e r 1   i n   t h e   C o n t o s o . c o m   d o m a i n   a n d   g e t s   t h e   s e r v e r   o b j e c t   f r o m   t h e   V M M   d a t a b a s e 
 
         .   T h e   f o l l o w i n g   c o m m a n d s   u s e   t h i s   s e r v e r   b y   d e f a u l t .   
 
         
 
         T h e   s e c o n d   c o m m a n d   g e t s   t h e   v i r t u a l   h a r d   d i s k   n a m e d   " B l a n k   D i s k   -   L a r g e "   f r o m   t h e   V M M   l i b r a r y   a n d   s t o r e s   t h e   v i r t u a 
 
         l   h a r d   d i s k   o b j e c t   i n   v a r i a b l e   $ V H D . 
 
         
 
         T h e   t h i r d   c o m m a n d   g e t s   t h e   o b j e c t   t h a t   r e p r e s e n t s   t h e   h o s t   n a m e d   V M H o s t 0 1   a n d   s t o r e s   t h e   h o s t   o b j e c t   i n   v a r i a b l e   $ V 
 
         M H o s t . 
 
         
 
         T h e   l a s t   c o m m a n d   c r e a t e s   a   v i r t u a l   m a c h i n e   n a m e d   V M 0 1   f r o m   t h e   v i r t u a l   h a r d   d i s k   c a l l e d   " B l a n k   D i s k   -   L a r g e "   a n d   d e 
 
         p l o y s   t h e   n e w   v i r t u a l   m a c h i n e   o n   t h e   C :   d r i v e   o f   V M H o s t 0 1   i n   t h e   M y V M s   f o l d e r .   T h e   - R u n A s y n c h r o n o u s l y   p a r a m e t e r   r e t 
 
         u r n s   c o n t r o l   t o   t h e   s h e l l   i m m e d i a t e l y   ( b e f o r e   t h e   c o m m a n d   c o m p l e t e s ) . 
 
         
 
         
 
         
 
         E X A M P L E   2 :   C r e a t e   a   v i r t u a l   m a c h i n e   f r o m   a   t e m p l a t e   a n d   d e p l o y   i t   o n   a   h o s t . 
 
         
 
         P S   C : \ >   $ T e m p l a t e   =   G e t - T e m p l a t e   - V M M S e r v e r   " V M M S e r v e r 1 . C o n t o s o . c o m "   |   w h e r e   { $ _ . N a m e   - e q   " G o l d   W i n d o w s   S e r v e r   2 0 0 3 
 
           R 2 " } 
 
         
 
         P S   C : \ >   $ V M H o s t   =   G e t - V M H o s t   |   w h e r e   { $ _ . N a m e   - e q   " V M H o s t 0 2 . C o n t o s o . c o m " } 
 
         
 
         P S   C : \ >   N e w - V M   - T e m p l a t e   $ T e m p l a t e   - N a m e   " V M 0 2 "   - V M H o s t   $ V M H o s t   - P a t h   " C : \ D o c u m e n t s   a n d   S e t t i n g s \ A l l   U s e r s \ D o c u m e n t 
 
         s \ S h a r e d   V i r t u a l   M a c h i n e s \ "   - R u n A s y n c h r o n o u s l y   - C o m p u t e r N a m e   " S e r v e r - 0 1 "   - F u l l N a m e   " R a c h e l   V a l d e z "   - O r g N a m e   " C o n t o s 
 
         o   C o r p "   - P r o d u c t K e y   " X X X X X - X X X X X - X X X X X - X X X X X - X X X X X " 
 
         
 
         
 
         T h e   f i r s t   c o m m a n d   g e t s   t h e   o b j e c t   t h a t   r e p r e s e n t s   t h e   t e m p l a t e   n a m e d   " G o l d   W i n d o w s   S e r v e r   2 0 0 3   R 2 "   a n d   s t o r e s   t h e   t 
 
         e m p l a t e   o b j e c t   i n   $ T e m p l a t e . 
 
         
 
         T h e   s e c o n d   c o m m a n d   g e t s   t h e   o b j e c t   t h a t   r e p r e s e n t s   t h e   h o s t   n a m e d   V M H o s t 0 2   a n d   s t o r e s   t h e   h o s t   o b j e c t   i n   $ V M H o s t . 
 
         
 
         T h e   l a s t   c o m m a n d   u s e s   t h e   N e w - V M   c m d l e t   t o   p e r f o r m   t h e   f o l l o w i n g   t a s k s : 
 
         
 
         *   C r e a t e   a   v i r t u a l   m a c h i n e   f r o m   t h e   " G o l d   W i n d o w s   S e r v e r   2 0 0 3   R 2 "   
 
             t e m p l a t e . 
 
         
 
         *   N a m e   t h e   n e w   v i r t u a l   m a c h i n e   V M 0 2 . 
 
         
 
         *   D e p l o y   t h e   n e w   v i r t u a l   m a c h i n e   o n   V M H o s t 0 2   a n d   s p e c i f y   t h e   p a t h   
 
             w h e r e   t h e   v i r t u a l   m a c h i n e   f i l e s   w i l l   b e   s t o r e d   o n   V M H o s t 0 2 :   
 
         
 
             C : \ D o c u m e n t s   a n d   S e t t i n g s \ A l l   U s e r s \ D o c u m e n t s \ S h a r e d   V i r t u a l   M a c h i n e s \ 
 
         
 
         *   S p e c i f y   t h a t   t h e   c o m m a n d   r u n   a s y n c h r o n o u s l y   t o   r e t u r n   c o n t r o l   
 
             t o   t h e   s h e l l   i m m e d i a t e l y   ( b e f o r e   t h e   c o m m a n d   c o m p l e t e s ) . 
 
         
 
         *   S e t s   t h e   f o l l o w i n g   i n f o r m a t i o n   f o r   V M 0 2 : 
 
         
 
                 -   S e r v e r - 0 1 . C o n t o s o . c o m   ( t h e   c o m p u t e r   n a m e   a n d   d o m a i n   f o r   
 
                     V M 0 2   t h a t   a p p e a r s   o n   t h e   C o m p u t e r   N a m e   t a b   o f   S y s t e m   P r o p e r t i e s ) 
 
         
 
                 -   R a c h e l   V a l d e z   ( t h e   n a m e   o f   t h e   p e r s o n   t h a t   a p p e a r s   o n   t h e   G e n e r a l   
 
                     t a b   o f   S y s t e m   P r o p e r t i e s ) 
 
         
 
                 -   C o n t o s o C o r p   ( t h e   o r g a n i z a t i o n   n a m e   t h a t   a p p e a r s   o n   t h e   G e n e r a l   t a b   
 
                     o f   S y s t e m   P r o p e r t i e s ) 
 
         
 
                 -   X X X X X - X X X X X - X X X X X - X X X X X - X X X X X   ( t h e   p r o d u c t   k e y   -   s u b s t i t u t e   
 
                     y o u r   2 5 - d i g i t   p r o d u c t   k e y   n u m b e r   f o r   t h e   X ' s ) 
 
         
 
         
 
         
 
         E X A M P L E   3 :   C l o n e   a   v i r t u a l   m a c h i n e   f r o m   a n   e x i s t i n g   v i r t u a l   m a c h i n e . 
 
         
 
         P S   C : \ >   G e t - V M M S e r v e r   - C o m p u t e r N a m e   " V M M S e r v e r 1 . C o n t o s o . c o m " 
 
         P S   C : \ >   $ V M   =   G e t - V M   |   w h e r e   { $ _ . N a m e   - e q   " V M 0 3 " } 
 
         P S   C : \ >   $ V M H o s t   =   G e t - V M H o s t   |   w h e r e   {   $ _ . N a m e   - e q   " V M H o s t 0 3 . C o n t o s o . c o m "   } 
 
         P S   C : \ >   i f ( $ V M . S t a t u s   - e q   " P o w e r O f f " ) { N e w - V M   - N a m e   " V M 0 4 "   - V M   $ V M   - V M H o s t   $ V M H o s t   - P a t h   " C : \ M y V M s "    R u n A s y n c h r o n o u s 
 
         l y } 
 
         
 
         
 
         T h e   f i r s t   c o m m a n d   c o n n e c t s   t o   V M M S e r v e r 1 .   
 
         
 
         T h e   s e c o n d   c o m m a n d   g e t s   t h e   o b j e c t   t h a t   r e p r e s e n t s   t h e   V M   n a m e d   V M 0 3   a n d   s t o r e s   t h e   v i r t u a l   m a c h i n e   o b j e c t   i n   $ V M . 
 
         
 
         T h e   t h i r d   c o m m a n d   g e t s   t h e   o b j e c t   t h a t   r e p r e s e n t s   t h e   h o s t   n a m e d   V M H o s t 0 3   a n d   s t o r e s   t h e   h o s t   o b j e c t   i n   $ V M H o s t . 
 
         
 
         T h e   l a s t   c o m m a n d   f i r s t   c h e c k s   i f   t h e   V M   i s   i n   a   p o w e r e d   o f f   s t a t e .   I f   t h e   V M   i s   p o w e r e d   o f f ,   t h e   c o m m a n d   c r e a t e s   a   
 
         v i r t u a l   m a c h i n e   n a m e d   V M 0 4   f r o m   V M 0 3   a n d   d e p l o y s   t h e   n e w   v i r t u a l   m a c h i n e   o n   t h e   C : \   d r i v e   o f   V M H o s t 0 3   i n   t h e   M y V M s   
 
         f o l d e r .   T h e   - R u n A s y n c h r o n o u s l y   p a r a m e t e r   r e t u r n s   c o n t r o l   t o   t h e   s h e l l   i m m e d i a t e l y   ( b e f o r e   t h e   c o m m a n d   c o m p l e t e s ) . 
 
         
 
         
 
         
 
         E X A M P L E   4 .   C r e a t e   a   v i r t u a l   m a c h i n e   f r o m   a   v i r t u a l   m a c h i n e   s t o r e d   i n   t h e   l i b r a r y . 
 
         
 
         P S   C : \ >   G e t - V M M S e r v e r   " V M M S e r v e r 1 . c o n t o s o . c o m " 
 
         
 
         P S   C : \ >   $ V M H o s t   =   G e t - V M H o s t   |   w h e r e   { $ _ . N a m e   - e q   " V M H o s t 0 4 " } 
 
         
 
         P S   C : \ >   $ V M   =   G e t - V M   - N a m e   " S t o r e d V M "   |   w h e r e   { $ _ . L i b r a r y S e r v e r . N a m e   - e q   " F i l e S e r v e r 0 1 " }   |   w h e r e   { $ _ . L o c a t i o n   - e q   " 
 
         \ \ F i l e S e r v e r 0 1 \ M S S C V M M L i b r a r y \ S t o r e d V M \ " } 
 
         
 
         P S   C : \ >   N e w - V M   - V M   $ V M   - N a m e   " V M 0 4 "   - D e s c r i p t i o n   " N e w   V M   f r o m   V M   s t o r e d   i n   L i b r a r y "   - O w n e r   " C o n t o s o \ V M M A d m i n "   - V M H o 
 
         s t   $ V M H o s t   - P a t h   " C : \ M y V M s "   - R u n A s y n c h r o n o u s l y   - R u n A s S y s t e m   - S t a r t A c t i o n   N e v e r A u t o T u r n O n V M   - U s e H a r d w a r e A s s i s t e d V i r t 
 
         u a l i z a t i o n   $ F A L S E   - S t o p A c t i o n   S a v e V M   - M e m o r y M B   1 0 2 4 
 
         
 
         
 
         T h e   f i r s t   c o m m a n d   c o n n e c t s   t o   V M M S e r v e r 1 . 
 
         
 
         T h e   s e c o n d   c o m m a n d   g e t s   t h e   o b j e c t   f o r   t h e   h o s t   n a m e d   V M H o s t 0 4   a n d   s t o r e s   t h e   h o s t   o b j e c t   i n   $ V M H o s t . 
 
         
 
         T h e   t h i r d   c o m m a n d   g e t s   t h e   o b j e c t   f o r   t h e   V M   n a m e d   S t o r e d V M ,   w h i c h   i s   l o c a t e d   a t   t h e   s p e c i f i e d   p a t h   o n   l i b r a r y   s e r v 
 
         e r   F i l e S e r v e r 0 1 ,   a n d   s t o r e s   t h e   v i r t u a l   m a c h i n e   o b j e c t   i n   $ V M . 
 
         
 
         T h e   l a s t   c o m m a n d   u s e s   t h e   N e w - V M   c m d l e t   t o   p e r f o r m   t h e   f o l l o w i n g   o p e r a t i o n s : 
 
         
 
         *   C r e a t e s   a   n e w   V M   n a m e d   V M 0 4   f r o m   S t o r e d V M   a n d   p r o v i d e s   
 
             V M 0 4   w i t h   1 0 2 4   M B   o f   m e m o r y . 
 
         
 
         *   D e p l o y s   V M 0 4   o n   h o s t   V M H o s t 0 4   a t   t h e   s p e c i f i e d   p a t h . 
 
         
 
         *   P r o v i d e s   a   d e s c r i p t i o n   a n d   s p e c i f i e s   V M M A d m i n   a s   t h e   o w n e r . 
 
         
 
         *   U s e s   t h e   - R u n A s y n c h r o n o u s l y   p a r a m e t e r   t o   r e t u r n   c o n t r o l   t o   t h e   s h e l l   
 
             i m m e d i a t e l y   ( b e f o r e   t h e   c o m m a n d   c o m p l e t e s ) .   
 
         
 
         *   U s e s   t h e   - R u n A s S y s t e m   p a r a m e t e r   t o   s p e c i f y   t h a t   t h e   V M   r u n s   u n d e r   t h e   
 
             l o c a l   s y s t e m   a c c o u n t   ( i t   i s   o n l y   n e c e s s a r y   t o   s p e c i f y   t h i s   f o r   a   V M   o n 
 
             a   V i r t u a l   S e r v e r   h o s t   b e c a u s e   H y p e r - V   a n d   V M w a r e   r u n   a   V M   u n d e r   t h e   
 
             l o c a l   s y s t e m   a c c o u n t   b y   d e f a u l t ) . 
 
         
 
         *   S p e c i f i e s   t h a t   h a r d w a r e   a s s i s t e d   v i r t u a l i z a t i o n   i s   n o t   u s e d . 
 
         
 
         *   S p e c i f i e s   t h a t   t h e   s t a r t   a c t i o n   f o r   t h e   n e w   V M   i s   s e t   t o   n e v e r   t u r n   o n   
 
             a u t o m a t i c a l l y   a n d   t h a t   t h e   s t o p   a c t i o n   i s   s e t   t o   s a v e   t h e   V M . 
 
         
 
         
 
         
 
         E X A M P L E   5 .   C r e a t e   a   h i g h l y   a v a i l a b l e   v i r t u a l   m a c h i n e . 
 
         
 
         P S   C : \ >   G e t - V M M S e r v e r   " V M M S e r v e r 1 . C o n t o s o . c o m " 
 
         
 
         P S   C : \ >   $ V M G u i d   =   [ S y s t e m . G u i d ] : : N e w G u i d ( ) . T o S t r i n g ( ) 
 
         
 
         P S   C : \ >   $ V M N a m e   =   " H A V M 0 1 " 
 
         
 
         P S   C : \ >   N e w - V i r t u a l N e t w o r k A d a p t e r   - J o b G r o u p   $ V M G u i d   - P h y s i c a l A d d r e s s T y p e   D y n a m i c   - V L A N E n a b l e d   $ F A L S E   
 
         
 
         P S   C : \ >   N e w - V i r t u a l D V D D r i v e   - J o b G r o u p   $ V M G u i d   - B u s   1   - L U N   0   
 
         
 
         P S   C : \ >   N e w - H a r d w a r e P r o f i l e   - O w n e r   " C o n t o s o \ V M M A d m i n "   - N a m e   " H W P r o f i l e "   - C P U C o u n t   1   - M e m o r y M B   5 1 2   - H i g h l y A v a i l a b l e   
 
         $ T R U E   - N u m L o c k   $ F A L S E   - B o o t O r d e r   " C D " ,   " I d e H a r d D r i v e " ,   " P x e B o o t " ,   " F l o p p y "   - L i m i t C P U F u n c t i o n a l i t y   $ F A L S E   - J o b G r o u p   
 
         $ V M G u i d 
 
         
 
         P S   C : \ >   N e w - V i r t u a l D i s k D r i v e   - I D E   - B u s   0   - L U N   0   - J o b G r o u p   $ V M G u i d   - S i z e   4 0 9 6 0   - D y n a m i c   - F i l e n a m e   " V M M - H A V M _ d i s k _ 1 . v 
 
         h d "   
 
         
 
         P S   C : \ >   $ V M H o s t   =   G e t - V M H o s t   |   w h e r e   { $ _ . N a m e   - e q   " V M M - H V N o d e 2 . S C V M M . C o n t o s o . c o m " } 
 
         
 
         P S   C : \ >   $ H a r d w a r e P r o f i l e   =   G e t - H a r d w a r e P r o f i l e   |   w h e r e   { $ _ . N a m e   - e q   " H W P r o f i l e " } 
 
         
 
         P S   C : \ >   $ O p e r a t i n g S y s t e m   =   G e t - O p e r a t i n g S y s t e m   |   w h e r e   { $ _ . N a m e   - e q   " 6 4 - b i t   e d i t i o n   o f   W i n d o w s   S e r v e r   2 0 0 8   D a t a c e n t 
 
         e r " } 
 
         
 
         P S   C : \ >   N e w - V M   - N a m e   $ V M N a m e   - D e s c r i p t i o n   " "   - O w n e r   " C o n t o s o \ V M M A d m i n "   - V M H o s t   $ V M H o s t   - P a t h   " P : \ "   - H a r d w a r e P r o f i l e 
 
           $ H a r d w a r e P r o f i l e   - J o b G r o u p   $ V M G u i d   - O p e r a t i n g S y s t e m   $ O p e r a t i n g S y s t e m   - R u n A s y n c h r o n o u s l y   - R u n A s S y s t e m   - S t a r t A c t i o n   
 
         N e v e r A u t o T u r n O n V M   - S t o p A c t i o n   S a v e V M   - U s e H a r d w a r e A s s i s t e d V i r t u a l i z a t i o n   $ F A L S E 
 
         
 
         
 
         T h e   f i r s t   c o m m a n d   c o n n e c t s   t o   V M M S e r v e r 1 . 
 
         
 
         T h e   s e c o n d   c o m m a n d   c r e a t e s   a   n e w   G U I D   s t r i n g   a n d   s t o r e s   i t   i n   $ V M G u i d .   T h i s   G U I D   i s   a   j o b   g r o u p   I D   t h a t   f u n c t i o n s   a 
 
         s   a n   i d e n t i f i e r   t h a t   g r o u p s   s u b s e q u e n t   c o m m a n d s   t h a t   i n c l u d e   t h i s   i d e n t i f i e r   i n t o   a   s i n g l e   j o b   g r o u p . 
 
         
 
         T h e   t h i r d   c o m m a n d   s t o r e s   a   s t r i n g   ( " H A V M 0 1 " )   u s e d   t o   n a m e   t h e   n e w   V M   i n   $ V M N a m e . 
 
         
 
         T h e   f o u r t h   c o m m a n d   w i l l   c r e a t e   a   n e w   v i r t u a l   n e t w o r k   a d a p t e r   w i t h   a   d y n a m i c   M A C   a d d r e s s   a n d   w i t h   V L A N   d i s a b l e d ,   b u t 
 
           u s e s   t h e   j o b   g r o u p   I D   t o   s p e c i f y   t h a t   t h e   n e t w o r k   a d a p t e r   i s   n o t   c r e a t e d   u n t i l   j u s t   b e f o r e   t h e   N e w - V M   c m d l e t   ( i n   t 
 
         h e   l a s t   c o m m a n d )   r u n s . 
 
         
 
         T h e   f i f t h   c o m m a n d   w i l l   c r e a t e   a   n e w   I D E   v i r t u a l   D V D   d r i v e   c o n n e c t e d   t o   t h e   s e c o n d   c h a n n e l   a n d   t h e   f i r s t   s l o t ,   b u t   u 
 
         s e s   t h e   j o b   g r o u p   I D   t o   s p e c i f y   t h a t   t h e   v i r t u a l   D V D   d r i v e   i s   n o t   c r e a t e d   u n t i l   j u s t   b e f o r e   t h e   N e w - V M   c m d l e t   ( i n   t 
 
         h e   l a s t   c o m m a n d )   r u n s . 
 
         
 
         T h e   s i x t h   c o m m a n d   w i l l   c r e a t e   a   n e w   h a r d w a r e   p r o f i l e   a n d   s p e c i f i e s   v a l u e s   f o r   t h e   p r o f i l e   n a m e ,   o w n e r ,   C P U   c o u n t ,   m 
 
         e m o r y ,   a n d   b o o t o r d e r ;   d i s a b l e s   N u m L o c k   a s   w e l l   a s   l i m i t e d   C P U   f u n c t i o n a l i t y   ( w h i c h   i s   n o t   n e e d e d   b e c a u s e   t h i s   i s   V M 
 
           w i l l   n o t   h a v e   a n   o l d e r   o p e r a t i n g   s y s t e m ) ;   a n d   d e s i g n a t e s   t h a t   t h e   V M   c r e a t e d   b y   u s i n g   t h i s   h a r d w a r e   p r o f i l e   w i l l   b 
 
         e   a   h i g h l y   a v a i l a b l e   V M .   T h e   c o m m a n d   u s e s   t h e   j o b   g r o u p   I D   t o   s p e c i f y   t h a t   t h e   h a r d w a r e   p r o f i l e   i s   n o t   c r e a t e d   u n t i 
 
         l   j u s t   b e f o r e   t h e   N e w - V M   c m d l e t   ( i n   t h e   l a s t   c o m m a n d )   r u n s .   
 
         
 
         T h e   s e v e n t h   c o m m a n d   w i l l   c r e a t e   a   n e w   I D E   v i r t u a l   d i s k   d r i v e   w i t h   a   s t o r a g e   c a p a c i t y   o f   4   G B   o n   t h e   f i r s t   c h a n n e l   a 
 
         n d   f i r s t   s l o t ,   b u t   u s e s   t h e   j o b   g r o u p   I D   t o   s p e c i f y   t h a t   t h e   n e w   v i r t u a l   d i s k   d r i v e   i s   n o t   c r e a t e d   u n t i l   j u s t   b e f o r 
 
         e   t h e   N e w - V M   c m d l e t   ( i n   t h e   l a s t   c o m m a n d )   r u n s .   
 
         
 
         T h e   e i g h t h   c o m m a n d   g e t s   a   V M   h o s t   o b j e c t   b y   n a m e   ( V M M - H V N o d e 2 )   a n d   s t o r e s   t h e   h o s t   o b j e c t   i n   $ V M H o s t .   T h i s   h o s t   i s   
 
         o n e   n o d e   o f   a   h o s t   c l u s t e r   t h a t   i s   m a n a g e d   b y   V M M . 
 
         
 
         T h e   n i n t h   c o m m a n d   g e t s   t h e   o b j e c t   t h a t   r e p r e s e n t s   t h e   h a r d w a r e   p r o f i l e   s p e c i f i e d   i n   t h e   f i f t h   c o m m a n d   b y   n a m e ,   a n d   
 
         s t o r e s   t h e   r e t u r n   v a l u e   i n   $ H a r d w a r e P r o f i l e .   
 
         
 
         T h e   t e n t h   c o m m a n d   g e t s   a n   o p e r a t i n g   s y s t e m   o b j e c t   b y   n a m e   a n d   s t o r e s   t h e   r e t u r n   v a l u e   i n   $ O p e r a t i n g S y s t e m .   
 
         
 
         T h e   l a s t   c o m m a n d   u s e s   t h e   N e w - V M   c m d l e t   a n d   t h e   j o b   g r o u p   I D   t o   c r e a t e   a   n e w   V M   n a m e d   H A V M 0 1   b y   u s i n g   t h e   o b j e c t s   o 
 
         b t a i n e d   o r   c r e a t e d   i n   t h e   p r e c e d i n g   c o m m a n d s .   T h e   c o m m a n d   a l s o   p e r f o r m s   t h e   f o l l o w i n g   o p e r a t i o n s : 
 
         
 
         *   U s e s   t h e   P a t h   p a r a m e t e r   t o   s p e c i f y   t h e   l o c a t i o n   w h e r e   t h e   V M   i s   s t o r e d ;   
 
             t h i s   l o c a t i o n   m u s t   b e   a   c l u s t e r - m i g r a t a b l e   L U N .   
 
         
 
         *   U s e s   t h e   R u n A s y n c h r o n o u s l y   p a r a m e t e r   t o   r e t u r n   c o n t r o l   t o   t h e   s h e l l   
 
             i m m e d i a t e l y   ( b e f o r e   t h e   c o m m a n d   c o m p l e t e s ) 
 
         
 
         *   U s e s   t h e   - R u n A s S y s t e m   p a r a m e t e r   t o   s p e c i f y   t h a t   t h e   V M   r u n s   u n d e r   
 
             t h e   l o c a l   s y s t e m   a c c o u n t   ( i t   i s   o n l y   n e c e s s a r y   t o   s p e c i f y   t h i s   f o r   a   
 
             V M   o n   a   V i r t u a l   S e r v e r   h o s t   b e c a u s e   H y p e r - V   a n d   V M w a r e   r u n   a   V M   u n d e r   
 
             t h e   l o c a l   s y s t e m   a c c o u n t   b y   d e f a u l t ) . 
 
         
 
         *   S p e c i f i e s   t h a t   t h e   V M   i s   n o t   s t a r t e d   a u t o m a t i c a l l y   w h e n   t h e   h o s t   
 
             s t a r t s   a n d   t h a t   t h e   V M   i s   p u t   i n t o   a   s a v e d   s t a t e   w h e n   t h e   
 
             v i r t u a l i z a t i o n   s e r v i c e   s t o p s . 
 
         
 
         *   S p e c i f i e s   t h a t   h a r d w a r e - a s s i s t e d   v i r t u a l i z a t i o n   i s   n o t   u s e d . 
 
         
 
         
 
         
 
         E X A M P L E   6 :   U s e   a n   e x i s t i n g   V H D   f i l e   o n   t h e   d e s t i n a t i o n   h o s t   t o   c r e a t e   a   n e w   v i r t u a l   m a c h i n e   f r o m   a   t e m p l a t e . 
 
         
 
         P S   C : \ >   G e t - V M M S e r v e r   - C o m p u t e r N a m e   " V M M S e r v e r 1 . C o n t o s o . c o m " 
 
         
 
         P S   C : \ >   $ J o b G r o u p I D   =   [ G u i d ] : : N e w G u i d ( ) . T o S t r i n g ( ) 
 
         
 
         P S   C : \ >   $ T e m p l a t e   =   G e t - T e m p l a t e   |   w h e r e   { $ _ . N a m e   - e q   M y T e m p l a t e " } 
 
         
 
         P S   C : \ >   $ V M H o s t   =   G e t - V M H o s t   |   w h e r e   { $ _ . N a m e   - e q   " V M H o s t 0 6 . C o n t o s o . c o m " } 
 
         
 
         P S   C : \ >   M o v e - V i r t u a l H a r d D i s k   - I D E   - B U S   0   - L U N   0   - P a t h   " L : \ O S . V H D "   - J o b G r o u p   $ J o b G r o u p I D 
 
         
 
         P S   C : \ >   N e w - V M   - N a m e   " V M 0 6 "   - P a t h   " L : \ "   - T e m p l a t e   $ T e m p l a t e   - V M H o s t   $ V M H o s t   - J o b G r o u p   - $ J o b G r o u p I D   - U s e L o c a l V i r t u a l 
 
         H a r d D i s k s 
 
         
 
         
 
         T h e   f i r s t   c o m m a n d   c o n n e c t s   t o   t h e   V M M S e r v e r 1   s e r v e r . 
 
                 
 
         T h e   s e c o n d   c o m m a n d   g e n e r a t e s   a   g l o b a l l y   u n i q u e   i d e n t i f i e r   ( G U I D )   a n d   s t o r e s   t h e   G U I D   s t r i n g   i n   t h e   $ J o b G r o u p I D   v a r i 
 
         a b l e .   T h e   j o b   g r o u p   I D   f u n c t i o n s   a s   a n   i d e n t i f i e r   t h a t   g r o u p s   s u b s e q u e n t   c o m m a n d s   t h a t   i n c l u d e   t h i s   i d e n t i f i e r   i n t o 
 
           a   s i n g l e   j o b   g r o u p . 
 
                 
 
         T h e   t h i r d   c o m m a n d   g e t s   t h e   o b j e c t   t h a t   r e p r e s e n t s   t h e   M y T e m p l a t e   t e m p l a t e   a n d   s t o r e s   t h e   t e m p l a t e   o b j e c t   i n   t h e   $ T e 
 
         m p l a t e   v a r i a b l e . 
 
                 
 
         T h e   f o u r t h   c o m m a n d   g e t s   t h e   o b j e c t   t h a t   r e p r e s e n t s   t h e   V M H o s t 0 6   h o s t   a n d   s t o r e s   t h e   h o s t   o b j e c t   i n   t h e   $ V M H o s t   v a r i 
 
         a b l e . 
 
                 
 
         T h e   f i f t h   c o m m a n d   c o n n e c t s   t h e   s p e c i f i e d   v i r t u a l   h a r d   d i s k   ( s t o r e d   o n   t h e   p h y s i c a l   h o s t   a t   L : \ O S . V H D )   t o   t h e   f i r s t   
 
         s l o t   ( 0 )   o f   t h e   p r i m a r y   c h a n n e l   ( 0 )   o n   t h e   v i r t u a l   I D E   c o n t r o l l e r   o n   t h e   v i r t u a l   m a c h i n e .   T h e   v i r t u a l   h a r d   d i s k   s t o 
 
         r e d   a t   L : \ O S . V H D   c o n t a i n s   t h e   o p e r a t i n g   s y s t e m   t h a t   w i l l   s t a r t   i n   t h e   v i r t u a l   m a c h i n e .   T h i s   c o m m a n d   s p e c i f i e s   t h a t   
 
         t h e   v i r t u a l   h a r d   d i s k   t h a t   t h e   n e w   v i r t u a l   m a c h i n e   w i l l   c o n n e c t   t o   i s   n o t   t h e   d e f a u l t   v i r t u a l   h a r d   d i s k   o n   t h e   t e m p 
 
         l a t e .   I n s t e a d ,   t h e   c o m m a n d   s p e c i f i e s   t h a t   t h e   n e w   v i r t u a l   m a c h i n e   c o n n e c t s   t o   L : \ O S . V H D .   
 
                 
 
         A d d i t i o n a l l y ,   t h e   f i f t h   c o m m a n d   u s e s   t h e   J o b G r o u p   p a r a m e t e r   t o   s p e c i f y   t h a t   t h i s   c o m m a n d   d o e s   n o t   a c t u a l l y   r u n   u n t i 
 
         l   t h e   N e w - V M   c m d l e t   t r i g g e r s   t h e   e x e c u t i o n   o f   a n y   c o m m a n d s   i n   t h e   J o b G r o u p   l i s t . 
 
                 
 
         T h e   l a s t   c o m m a n d   r u n s   a n y   c o m m a n d s   ( i n   t h i s   c a s e ,   M o v e - V i r t u a l H a r d D i s k )   t h a t   c o n t a i n   t h e   $ J o b G r o u p I D   v a r i a b l e .   A n d , 
 
           i t   c r e a t e s   t h e   n e w   V M 0 6   v i r t u a l   m a c h i n e .   
 
                 
 
         I n   t h i s   e x a m p l e : 
 
                 
 
         *   M y T e m p l a t e   i s   a s s u m e d   t o   h a v e   a   v i r t u a l   d i s k   d r i v e   
 
             o n   I D E   B u s   0   L U N   0   t h a t   c o n t a i n s   a   v i r t u a l   h a r d   d i s k . 
 
                 
 
         *   T h e   n e w   v i r t u a l   m a c h i n e   i s   c r e a t e d   f r o m   t h e   $ T e m p l a t e   
 
             v a r i a b l e .   T h e   v i r t u a l   m a c h i n e   i s   d e p l o y e d   o n   t h e   h o s t   
 
             s p e c i f i e d   i n   t h e   $ V M H o s t   v a r i a b l e .   A n d ,   t h e   v i r t u a l   
 
             m a c h i n e   i s   s t o r e d   i n   t h e   r o o t   d i r e c t o r y   o f   t h e   L :   d r i v e . 
 
                 
 
         *   T h e   U s e L o c a l V i r t u a l H a r d D i s k s   p a r a m e t e r   s p e c i f i e s   t h a t   
 
             N e w - V M   u s e   e x i s t i n g   v i r t u a l   h a r d   d i s k s   o n   t h e   h o s t   i n s t e a d   
 
             o f   p e r f o r m i n g   a   n e t w o r k   c o p y   o f   a   v i r t u a l   h a r d   d i s k   f r o m   
 
             t h e   l i b r a r y   b y   u s i n g   t h e   B a c k g r o u n d   I n t e l l i g e n t   T r a n s f e r   
 
             S e r v i c e   ( B I T S ) . 
 
                     
 
         *   T h e r e f o r e ,   t h e   v i r t u a l   h a r d   d i s k   a s s o c i a t e d   w i t h   t h e   
 
             v i r t u a l   d i s k   d r i v e   o n   t h e   t e m p l a t e   i s   r e p l a c e d   w i t h   
 
             a   v i r t u a l   h a r d   d i s k   t h a t   a l r e a d y   e x i s t s   o n   t h e   h o s t .   
 
             T h u s ,   t h e   v i r t u a l   h a r d   d i s k   a s s o c i a t e d   w i t h   t h e   
 
             v i r t u a l   d i s k   d r i v e   o n   t h e   n e w   v i r t u a l   m a c h i n e   i s   L : \ O S . V H D . 
 
                 
 
         *   A s   a   r e s u l t ,   b o t h   t h e   v i r t u a l   m a c h i n e   a n d   i t s   o p e r a t i n g   s y s t e m   
 
             a r e   s t o r e d   o n   t h e   L :   d r i v e   o n   t h e   h o s t .   C o n t r a s t   
 
             t h i s   e x a m p l e   w i t h   t h e   n e x t   e x a m p l e ,   w h i c h   s t o r e s   t h e   v i r t u a l   
 
             m a c h i n e   a n d   i t s   o p e r a t i n g   s y s t e m   o n   d i f f e r e n t   d r i v e s . 
 
         
 
         
 
         
 
         E X A M P L E   7 :   U s e   a n   e x i s t i n g   V H D   o n   t h e   d e s t i n a t i o n   h o s t   t o   c r e a t e   a   v i r t u a l   m a c h i n e   f r o m   a   t e m p l a t e ,   a n d   m o v e   a n o t h e 
 
         r   V H D   t o   t h e   n e w   v i r t u a l   m a c h i n e . 
 
         
 
         P S   C : \ >   G e t - V M M S e r v e r   - C o m p u t e r N a m e    V M M S e r v e r 1 . C o n t o s o . c o m  
 
         
 
         P S   C : \ >   $ J o b G r o u p I D   =   [ g u i d ] : : N e w G u i d ( ) 
 
         
 
         P S   C : \ >   $ T e m p l a t e   =   G e t - T e m p l a t e   |   w h e r e   { $ _ . N a m e   - e q   " M y T e m p l a t e " } 
 
         
 
         P S   C : \ >   $ V M H o s t   =   G e t - V M H o s t   |   w h e r e   { $ _ . N a m e   - e q   " V M H o s t 0 7 . C o n t o s o . c o m " } 
 
         
 
         P S   C : \ >   $ V H D   =   G e t - V i r t u a l H a r d D i s k   - A L L   |   w h e r e   { $ _ . N a m e   - e q   " O t h e r . V h d " } 
 
         
 
         P S   C : \ >   M o v e - V i r t u a l H a r d D i s k   - I D E   - B U S   0   - L U N   0   - P a t h   " L : \ O S . V H D "   - J o b G r o u p   $ J o b G r o u p I D 
 
         
 
         P S   C : \ >   N e w - V i r t u a l D i s k D r i v e   - V i r t u a l H a r d D i s k   $ V H D   - I D E   - B U S   0   - L U N   1   - P a t h   " R : \ "   - F i l e n a m e   " O t h e r . V h d "   - J o b G r o u p   $ 
 
         J o b G r o u p I D 
 
         
 
         P S   C : \ >   N e w - V M   - N a m e   " V M 0 7 "   - P a t h   " D : \ V M s "   - T e m p l a t e   $ T e m p l a t e   - V M H o s t   $ V M H o s t   - J o b G r o u p   - $ J o b G r o u p I D   - U s e L o c a l V i r t 
 
         u a l H a r d D i s k s 
 
         
 
         
 
         T h e   f i r s t   f o u r   c o m m a n d s   a r e   i d e n t i c a l   t o   t h e   f i r s t   f o u r   c o m m a n d s   i n   t h e   p r e v i o u s   e x a m p l e . 
 
                 
 
         T h e   f i f t h   c o m m a n d   g e t s   t h e   O t h e r . V H D   v i r t u a l   h a r d   d i s k .   T h e   G e t - V i r t u a l   H a r d D i s k   c m d l e t   c a n   r e t r i e v e   v i r t u a l   h a r d   d 
 
         i s k   o b j e c t s   f r o m   a   v i r t u a l   m a c h i n e ,   f r o m   a   t e m p l a t e ,   o r   f r o m   a   s t a n d a l o n e   f i l e   s t o r e d   i n   t h e   V i r t u a l   M a c h i n e   M a n a g e 
 
         r   l i b r a r y .   S p e c i f y i n g   t h e   - A l l   p a r a m e t e r   r e t r i e v e s   a   f u l l   l i s t   o f   a l l   t h e   s u b o r d i n a t e   o b j e c t s   i n d e p e n d e n t   o f   t h e   p a 
 
         r e n t   o b j e c t .   I n   t h i s   c a s e ,   t h e   c o m m a n d   r e t r i e v e s   a l l   t h e   a v a i l a b l e   v i r t u a l   h a r d   d i s k   o b j e c t s   a n d   t h e n   s e l e c t s   O t h e r 
 
         . V H D . 
 
                 
 
         T h e   s i x t h   c o m m a n d   c o n n e c t s   t h e   s p e c i f i e d   v i r t u a l   h a r d   d i s k   ( s t o r e d   o n   t h e   p h y s i c a l   h o s t   a t   L : \ O S . V H D )   t o   t h e   f i r s t   
 
         s l o t   ( 0 )   o f   t h e   p r i m a r y   c h a n n e l   ( 0 )   o n   t h e   v i r t u a l   I D E   c o n t r o l l e r   o n   t h e   v i r t u a l   m a c h i n e .   T h e   v i r t u a l   h a r d   d i s k   s t o 
 
         r e d   a t   L : \ O S . V H D   c o n t a i n s   t h e   o p e r a t i n g   s y s t e m   t h a t   w i l l   s t a r t   i n   t h e   v i r t u a l   m a c h i n e .   T h i s   c o m m a n d   s p e c i f i e s   t h a t   
 
         t h e   v i r t u a l   h a r d   d i s k   t h a t   t h e   n e w   v i r t u a l   m a c h i n e   w i l l   c o n n e c t   t o   i s   n o t   t h e   d e f a u l t   v i r t u a l   h a r d   d i s k   o n   t h e   t e m p 
 
         l a t e .   I n s t e a d ,   t h e   c o m m a n d   s p e c i f i e s   t h a t   t h e   n e w   v i r t u a l   m a c h i n e   c o n n e c t s   t o   L : \ O S . V H D . 
 
                 
 
         A d d i t i o n a l l y ,   t h e   s i x t h   c o m m a n d   u s e s   t h e   J o b G r o u p   p a r a m e t e r   a n d   t h e   $ J o b G r o u p I D   v a r i a b l e   t o   s p e c i f y   t h a t   t h i s   c o m m a 
 
         n d   d o e s   n o t   a c t u a l l y   r u n   u n t i l   t h e   N e w - V M   c m d l e t   t r i g g e r s   t h e   e x e c u t i o n   o f   a n y   c o m m a n d s   i n   t h e   J o b G r o u p   l i s t . 
 
                 
 
         T h e   s e v e n t h   c o m m a n d   p e r f o r m s   t h e   f o l l o w i n g   a c t i o n s : 
 
                 
 
         *   I t   c r e a t e s   a   n e w   v i r t u a l   d i s k   d r i v e   o b j e c t .   
 
                 
 
         *   I t   a t t a c h e s   t h e   v i r t u a l   h a r d   d i s k   o b j e c t   ( O t h e r . V H D )   
 
             s t o r e d   i n   t h e   $ V H D   v a r i a b l e   t o   I D E   B u s   0   a n d   L U N   1   o n   
 
             t h e   n e w   v i r t u a l   d i s k   d r i v e .   
 
                 
 
         *   I t   u s e s   t h e   P a t h   p a r a m e t e r   t o   s t o r e   t h e   v i r t u a l   h a r d   
 
             d i s k   o b j e c t   i n   $ V H D   i n   t h e   r o o t   d i r e c t o r y   o f   t h e   R   d r i v e   
 
             o n   t h e   v i r t u a l   m a c h i n e ,   a n d   i t   s p e c i f i e s   t h a t   i t s   n a m e   
 
             i s   O t h e r . V H D . 
 
         
 
         *   I t   u s e s   $ J o b G r o u p I D   t o   s p e c i f y   t h a t   t h i s   c o m m a n d   d o e s   n o t   
 
             r u n   u n t i l   N e w - V M   i n   t h e   l a s t   c o m m a n d   t r i g g e r s   t h e   e x e c u t i o n   
 
             o f   a n y   c o m m a n d s   i n   t h e   J o b G r o u p   l i s t .             
 
         
 
         T h e   l a s t   c o m m a n d   r u n s   a n y   c o m m a n d s   ( i n   t h i s   c a s e ,   M o v e - V i r t u a l H a r d D i s k   a n d   N e w - V i r t u a l D i s k D r i v e )   t h a t   c o n t a i n   $ J o b G 
 
         r o u p I D ,   a n d   t h e n   i t   c r e a t e s   a   n e w   V M 0 7   v i r t u a l   m a c h i n e .   
 
                 
 
         I n   t h i s   e x a m p l e : 
 
                 
 
         *   M y T e m p l a t e   i s   a s s u m e d   t o   h a v e   a   v i r t u a l   d i s k   d r i v e   
 
             o n   I D E   B u s   0   a n d   L U N   0   t h a t   c o n t a i n s   a   v i r t u a l   h a r d   d i s k . 
 
                 
 
         *   T h e   n e w   v i r t u a l   m a c h i n e   i s   c r e a t e d   f r o m   t h e   $ T e m p l a t e   v a r i a b l e .   
 
             T h e   n e w   v i r t u a l   m a c h i n e   i s   d e p l o y e d   o n   t h e   h o s t   s p e c i f i e d   i n   
 
             t h e   $ V M H o s t   v a r i a b l e .   A n d ,   t h e   n e w   v i r t u a l   m a c h i n e   i s   s t o r e d   
 
             o n   t h e   D   d r i v e   i n   t h e   V M s   f o l d e r . 
 
                 
 
         *   T h e   U s e L o c a l V i r t u a l H a r d D i s k s   p a r a m e t e r   s p e c i f i e s   t h a t   N e w - V M   u s e   
 
             e x i s t i n g   v i r t u a l   h a r d   d i s k s   o n   t h e   h o s t   i n s t e a d   o f   p e r f o r m i n g   a   
 
             n e t w o r k   c o p y   o f   a   v i r t u a l   h a r d   d i s k   f r o m   t h e   l i b r a r y   b y   u s i n g   B I T S . 
 
                 
 
         *   T h e r e f o r e ,   t h e   v i r t u a l   h a r d   d i s k   a s s o c i a t e d   w i t h   t h e   
 
             v i r t u a l   d i s k   d r i v e   o n   t h e   t e m p l a t e   i s   r e p l a c e d   w i t h   
 
             a   v i r t u a l   h a r d   d i s k   t h a t   a l r e a d y   e x i s t s   o n   t h e   h o s t .   
 
             T h u s ,   t h e   v i r t u a l   h a r d   d i s k   a s s o c i a t e d   w i t h   t h e   
 
             v i r t u a l   d i s k   d r i v e   o n   t h e   n e w   v i r t u a l   m a c h i n e   i s   L : \ O S . V H D . 
 
                 
 
         *   A s   a   r e s u l t ,   t h e   p a t h   t o   t h e   n e w   v i r t u a l   m a c h i n e   i s   D : \ V M s \ V M 0 7 .   
 
             T h e   p a t h   t o   t h e   o p e r a t i n g   s y s t e m   i s   L : \ O S . V H D .   A n d ,   t h e   p a t h   t o   
 
             t h e   o t h e r   v i r t u a l   h a r d   d i s k   i s   R : \ O t h e r . V H D . 
 
         
 
         
 
         
 
 
 
 